package com.offcn.bean;

/**
 * @Author: 平川
 * @Description:
 * @Date Created in 2021-10-15 0:32
 * @Modified By:
 */
    //用来封装查询条件
    public class ConditionBean {

        //保存分类地区
        private String area;
        //保存分类类型
        private String type;
        //保存分类规格
        private String style;
        //保存分类年代
        private String year;
        //保存电影名称
        private String mname;
        //搜索关键字
        private String keyword;

        //请求是前台的还是后台的
        private String fromS;

        private String flag;

        public String getArea() {
            return area;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getStyle() {
            return style;
        }

        public void setStyle(String style) {
            this.style = style;
        }

        public String getYear() {
            return year;
        }

        public void setYear(String year) {
            this.year = year;
        }

        public String getMname() {
            return mname;
        }

        public void setMname(String mname) {
            this.mname = mname;
        }

        public String getKeyword() {
            return keyword;
        }

        public void setKeyword(String keyword) {
            this.keyword = keyword;
        }

        public String getFromS() {
            return fromS;
        }

        public void setFromS(String fromS) {
            this.fromS = fromS;
        }

        public String getFlag() {
            if (area != null && area.length() > 0) {
                this.flag = "地区";
            } else if (type != null && type.length() > 0) {
                this.flag = "类型";
            } else if (style != null && style.length() > 0) {
                this.flag = "规格";
            } else if (year != null && year.length() > 0) {
                this.flag = "我的年代";
            } else if (mname != null && mname.length() > 0) {
                this.flag = "电影名称";
            } else {
                this.flag = "";
            }

            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        @Override
        public String toString() {
            return "ConditionBean{" +
                    "area='" + area + '\'' +
                    ", type='" + type + '\'' +
                    ", style='" + style + '\'' +
                    ", year='" + year + '\'' +
                    ", mname='" + mname + '\'' +
                    ", keyword='" + keyword + '\'' +
                    ", fromS='" + fromS + '\'' +
                    ", flag='" + flag + '\'' +
                    '}';
        }
    }
